package org.rqb.listener;

import com.github.kwhat.jnativehook.keyboard.NativeKeyEvent;
import com.github.kwhat.jnativehook.keyboard.NativeKeyListener;
import com.github.kwhat.jnativehook.mouse.NativeMouseEvent;
import com.github.kwhat.jnativehook.mouse.NativeMouseListener;
import lombok.extern.slf4j.Slf4j;
import org.rqb.Main;
import org.rqb.frame.MyFrame;
import org.rqb.panel.ClickFrequencyPanel;

@Slf4j
public class ClickFrequencyKeyListener implements NativeMouseListener {

    private ClickFrequencyPanel clickFrequencyPanel;

    private MyFrame frame;

    public ClickFrequencyKeyListener(MyFrame frame, ClickFrequencyPanel clickFrequencyPanel) {
        this.frame = frame;
        this.clickFrequencyPanel = clickFrequencyPanel;
    }


    @Override
    public void nativeMouseClicked(NativeMouseEvent e) {
        //更新坐标位置
        clickFrequencyPanel.updateMouseXy(e.getX(),e.getY());

        //关闭监听器
        clickFrequencyPanel.closeListener();
    }



}
